\(\int \frac {\sec ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx\) [336]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 27 \[ \int \frac {\sec ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d} \]

[Out]

-2*I*(a+I*a*tan(d*x+c))^(1/2)/a/d

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {3568, 32} \[ \int \frac {\sec ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d} \]

[In]

Int[Sec[c + d*x]^2/Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

((-2*I)*Sqrt[a + I*a*Tan[c + d*x]])/(a*d)

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \text {Subst}\left (\int \frac {1}{\sqrt {a+x}} \, dx,x,i a \tan (c+d x)\right )}{a d} \\ & = -\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00 \[ \int \frac {\sec ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d} \]

[In]

Integrate[Sec[c + d*x]^2/Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

((-2*I)*Sqrt[a + I*a*Tan[c + d*x]])/(a*d)

Maple [A] (verified)

Time = 0.77 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89

method result size
derivativedivides \(-\frac {2 i \sqrt {a +i a \tan \left (d x +c \right )}}{a d}\) \(24\)
default \(-\frac {2 i \sqrt {a +i a \tan \left (d x +c \right )}}{a d}\) \(24\)

[In]

int(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-2*I*(a+I*a*tan(d*x+c))^(1/2)/a/d

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.37 \[ \int \frac {\sec ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {2 i \, \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} e^{\left (i \, d x + i \, c\right )}}{a d} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

-2*I*sqrt(2)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*e^(I*d*x + I*c)/(a*d)

Sympy [F]

\[ \int \frac {\sec ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\int \frac {\sec ^{2}{\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )}}\, dx \]

[In]

integrate(sec(d*x+c)**2/(a+I*a*tan(d*x+c))**(1/2),x)

[Out]

Integral(sec(c + d*x)**2/sqrt(I*a*(tan(c + d*x) - I)), x)

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.78 \[ \int \frac {\sec ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {2 i \, \sqrt {i \, a \tan \left (d x + c\right ) + a}}{a d} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

-2*I*sqrt(I*a*tan(d*x + c) + a)/(a*d)

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 55 vs. \(2 (21) = 42\).

Time = 0.60 (sec) , antiderivative size = 55, normalized size of antiderivative = 2.04 \[ \int \frac {\sec ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {2 i \, \sqrt {\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 i \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1}}}{a d} \]

[In]

integrate(sec(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="giac")

[Out]

-2*I*sqrt((a*tan(1/2*d*x + 1/2*c)^2 - 2*I*a*tan(1/2*d*x + 1/2*c) - a)/(tan(1/2*d*x + 1/2*c)^2 - 1))/(a*d)

Mupad [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.74 \[ \int \frac {\sec ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {\sqrt {\frac {a\,\left (2\,{\cos \left (c+d\,x\right )}^2+\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}\right )}{2\,{\cos \left (c+d\,x\right )}^2}}\,2{}\mathrm {i}}{a\,d} \]

[In]

int(1/(cos(c + d*x)^2*(a + a*tan(c + d*x)*1i)^(1/2)),x)

[Out]

-(((a*(sin(2*c + 2*d*x)*1i + 2*cos(c + d*x)^2))/(2*cos(c + d*x)^2))^(1/2)*2i)/(a*d)